package com.dgut.courses_selecting_sys.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.dgut.courses_selecting_sys.anno.ExcelColumn;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * <p>
 * 
 * </p>
 *
 * @author yuec
 * @since 2020-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long userId;

    private Integer deptId;

    @ExcelColumn(value = "账号", col = 1)
    private String loginName;

    @ExcelColumn(value = "姓名", col = 2)
    private String userName;

    private String password;

    @ExcelColumn(value = "性别", col = 3)
    private String sex;

    @ExcelColumn(value = "联系电话",col = 4)
    private String phonenumber;

    @ExcelColumn(value = "联系邮箱",col = 5)
    private String email;

    private String salt;

    private String avatus;

    @ExcelColumn(value = "用户状态",col = 6)
    private String status;

    @TableLogic
    private int deleted;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelColumn(value = "系统创建时间",col = 7)
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @Version
    private Integer version;


}
